home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Draw / Sources / DrawPrxy.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.6 KB  |  166 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrawPrxy.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRAWPRXY_H
  13. #define DRAWPRXY_H
  14.  
  15. #ifndef BASESHP_H
  16. #include "BaseShp.h"
  17. #endif
  18.  
  19. #ifndef BOUNDSHP_H
  20. #include "BoundShp.h"
  21. #endif
  22.  
  23. #ifndef LINESHP_H
  24. #include "LineShp.h"
  25. #endif
  26.  
  27. #ifndef OVALSHP_H
  28. #include "OvalShp.h"
  29. #endif
  30.  
  31. #ifndef RECTSHP_H
  32. #include "RectShp.h"
  33. #endif
  34.  
  35. #ifndef RRECTSHP_H
  36. #include "RRectShp.h"
  37. #endif
  38.  
  39. #ifndef TEXTSHP_H
  40. #include "TextShp.h"
  41. #endif
  42.  
  43. // ----- Part Layer -----
  44.  
  45. #ifndef FWFRMING_H
  46. #include "FWFrming.h"
  47. #endif
  48.  
  49. #ifndef FWPROXY_H
  50. #include "FWProxy.h"
  51. #endif
  52.  
  53. // ----- OpenDoc Includes -----
  54.  
  55. #ifndef SOM_ODShape_xh
  56. #include <Shape.xh>
  57. #endif
  58.  
  59. //========================================================================================
  60. // Forward Declaration
  61. //========================================================================================
  62.  
  63. class ODFrame;
  64. class ODTransform;
  65. class CDrawPart;
  66.  
  67. //========================================================================================
  68. //    class CProxyShape
  69. //========================================================================================
  70.  
  71. class CProxyShape : public CRectShape, public FW_MProxy
  72. {
  73.  public:
  74.     FW_DECLARE_CLASS
  75.     FW_DECLARE_AUTO(CProxyShape)
  76.     
  77. //----------------------------------------------------------------------------------------
  78. //    Initialization/Destruction
  79. //
  80. public:
  81.     CProxyShape(Environment* ev, const FW_CRect& rect, CDrawPart* drawPart);
  82.     CProxyShape(Environment* ev, CDrawPart* drawPart, FW_CReadableStream& archive);
  83.  
  84.     virtual ~CProxyShape();
  85.     
  86. //----------------------------------------------------------------------------------------
  87. //    Inherited API from FW_MProxy
  88. //
  89. public:
  90.     virtual void                 UsedShapeChanged(Environment* ev, 
  91.                                     FW_CEmbeddingFrame* embeddingFrame, 
  92.                                     ODFrame* odEmbeddedFrame);
  93.     
  94.     virtual ODShape*            FrameShapeRequested(Environment* ev, 
  95.                                     FW_CEmbeddingFrame* embeddingFrame, 
  96.                                     ODFrame* odEmbeddedFrame, 
  97.                                     ODShape* requestedFrameShape);
  98.                                             
  99. //----------------------------------------------------------------------------------------
  100. //    Inherited API from CRectShape and CBaseShape
  101. //
  102. public:
  103.     virtual void         Removed(Environment* ev);
  104.     virtual void        Deleted(Environment* ev);
  105.     virtual void        RestoreShape(Environment *ev, CDrawPart* drawPart);                
  106.  
  107.     virtual void         RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
  108.  
  109.     virtual void        SubtractToWindowClip(Environment *ev, 
  110.                                             CDrawFacetClipper* facetClipper, 
  111.                                             ODFacet* containingFacet, 
  112.                                             ODShape* windowClip,
  113.                                             ODShape* tempShape);
  114.     
  115.     virtual void        OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
  116.     virtual void        MapShape(Environment *ev, CDrawPart* part, const FW_CRect& srcRect, const FW_CRect& dstRect);
  117.     virtual void        GetHandleCenter(short whichHandle, FW_CPoint& center) const;
  118.     
  119.     virtual void         SelectShape(Environment *ev, FW_Boolean state);
  120.  
  121.     virtual void        ChangeRenderVerb(Environment *ev, CDrawPart* part, unsigned short renderVerb);
  122.     
  123.     virtual void        AdjustRectForPenSize(FW_CRect& rect, FW_Fixed penSize) const;
  124.  
  125.     // ----- z-Order -----
  126.     virtual void         MovedAfter(Environment *ev, CBaseShape* shape);
  127.     virtual void         MovedBefore(Environment *ev, CBaseShape* shape);
  128.     virtual void         MovedFirst(Environment *ev);
  129.     virtual void         MovedLast(Environment *ev);
  130.     
  131.     // ----- Frozen -----
  132.     virtual FW_Boolean    SetFrozen(FW_Boolean state);
  133.     virtual FW_Boolean     IsFrozen() const;
  134.  
  135.     // ----- Archiving -----
  136.     virtual void        Flatten(FW_CWritableStream& archive);    
  137.     static void*         Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
  138.  
  139.     // ----- Linking -----
  140.     virtual void        SetSubscribeLink(Environment* ev, 
  141.                             CDrawSubscribeLink *subscribeLink);
  142.     virtual void        SetPublishLink(Environment* ev, 
  143.                             CDrawPublishLink *subscribeLink);
  144.     virtual FW_Boolean    IsInLinkDestination(Environment* ev);
  145.  
  146. //-----------------------------------------------------------------------------------------
  147. //    New API
  148. //
  149. public:
  150.     void                 MoveBefore(Environment* ev, CProxyShape* before);
  151.     void                 MoveBehind(Environment* ev, CProxyShape* behind);
  152.     
  153.     FW_CRect            GetFrameRect(Environment* ev) const
  154.                                 {return fFrameRect;}
  155.  
  156. //----------------------------------------------------------------------------------------
  157. //    Data Member
  158. //
  159. private:
  160.     CDrawPart            *fDrawPart;
  161.     FW_Boolean            fFrozen;
  162.     FW_CRect            fFrameRect;        // cached frame Rect
  163. };
  164.  
  165. #endif
  166.